import service from '../server'

// 收支明细列表
export const getTransactionListApi = (data) => {
    return service.get('/api/v1/cost/transaction/list',data)
}

// 订单记录
export const getOrderListApi = (data) => {
    return service.get('/api/v1/cost/order/list',data)
}

// 账单明细
export const getBillListApi = (data) => {
    return service.get('/api/v1/cost/bill/list',data)
}

// 月度账单
export const getBillDateApi = (date) => {
    return service.get('/api/v1/cost/bill/' + date)
}

// 消费趋势
export const getBillTrendApi = (latitude) => {
    return service.get('/api/v1/cost/trend/' + latitude)
}

// 提现记录
export const getWithdrawListApi = () => {
    return service.get('/api/v1/cost/withdraw/list')
}

// 提现申请
export const applyWithdraw = (data) => {
    return service.post('/api/v1/cost/withdraw/apply', data)
}

// 提现账户新增/修改
export const addWithdrawAccount = (data) => {
    return service.post('/api/v1/cost/withdraw/account', data)
}

// 提现账户列表
export const getWithdrawAccountApi = (data) => {
    return service.get('/api/v1/cost/withdraw/account',data)
}

/** 发票  */
// 发票收件信息列表
export const getInvoiceAddressListApi = (data) => {
    return service.get('/api/v1/cost/invoice/address', data)
}

// 添加发票收件信息
export const addInvoiceAddressListApi = (data) => {
    return service.post('/api/v1/cost/invoice/address/add', data)
}

// 删除发票收件信息
export const delInvoiceAddressListApi = (id) => {
    return service.delete('/api/v1/cost/invoice/address/'+ id)
}

// 发票信息列表
export const getInvoiceListApi = (data) => {
    return service.get('/api/v1/cost/invoice/info', data)
}

// 更新发票信息
export const upsetInvoiceApi = (data) => {
    return service.post('/api/v1/cost/invoice/upset', data)
}

// 删除发票信息
export const delInvoiceApi = (id) => {
    return service.delete('/api/v1/cost/invoice/' + id )
}

// 开票记录列表
export const getApplyInvoiceListApi = (data) => {
    return service.get('/api/v1/cost/invoice/apply/list', data)
}

// 申请开票
export const applyInvoiceListApi = (data) => {
    return service.post('/api/v1/cost/invoice/apply', data)
}

// 撤回开票申请
export const delApplyInvoiceApi = (id) => {
    return service.delete('/api/v1/cost/invoice/apply/revoke/' + id )
}

// 获取券发放记录列表
export const getUserTicketListApi = (data) => {
    return service.get('/api/v1/user/ticketlist', data)
}

// 券兑换接口
export const redeemTicket= (data) => {
    return service.post('/api/v1/user/redeem', data)
}

// 订单明细
export const getOrderDetailsApi = (orderId) => {
    return service.get('/api/v1/cost/order/'+ orderId)
}

